import { useRouter } from 'vue-router'

export var breadcrumbRoutes = () => {
  let routes = []
  const router = useRouter()
  const entry = router.currentRoute.value.matched.slice(-2)
  entry.forEach((item) => {
    routes.push({
      name: item.name,
      path: item.path,
      label: item.meta.label
    })
  })
  return routes
}
